import java.util.Scanner;

public class PassAndGood {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt(); // 考试人数
        int[] scores = new int[n];
        int pass = 0;
        int good = 0;
        for (int i = 0; i < n; i++) {
            scores[i] = scan.nextInt();
            if (scores[i] >= 60) {
                pass ++;
            }
            if (scores[i] >= 85) {
                good ++;
            }
        }
        int passRate = (int) (Math.round(pass * 100/ (n * 1.0)));
        int goodRate = (int)(Math.round(good * 100 / (n * 1.0)));
        System.out.println(passRate + "%");
        System.out.println(goodRate + "%");
        scan.close();
    }
}
